package com.szb.controller;

import com.szb.entity.ContainerInfo;
import com.szb.service.DockerLogsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/docker")
public class LogDockerController {

    @Autowired
    DockerLogsService dockerLogsService;

    @GetMapping("/containers")
    public List<ContainerInfo> getRunningContainers() {
        return dockerLogsService.getRunningContainersInfo();

    }
}
